;(function($){
	jQuery.fn.extend({
		'getvideo':function(){
			var _videoFlash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="FLASHWIDTH" height="FLASHHEIGHT">'
		        + '<param value="transparent" name="wmode"/>'
				+ '<param value="FLASHADDR" name="movie" />'
				+ '<embed src="FLASHADDR" wmode="transparent" allowfullscreen="true" type="application/x-shockwave-flash" width="FLASHWIDTH" height="FLASHHEIGHT"></embed>'
				+ '</object>';
			//视频获取规则
			var _flashAddr = {
				'youku.com' : 'http://player.youku.com/player.php/sid/FLASHVAR=/v.swf',
				'ku6.com' : 'http://player.ku6.com/refer/FLASHVAR/v.swf',
				'youtube.com' : 'http://www.youtube.com/v/FLASHVAR',
				'5show.com' : 'http://www.5show.com/swf/5show_player.swf?flv_id=FLASHVAR',
				'sina.com.cn' : 'http://vhead.blog.sina.com.cn/player/outer_player.swf?vid=FLASHVAR',
				'sohu.com' : 'http://v.blog.sohu.com/fo/v4/FLASHVAR',
				'mofile.com' : 'http://tv.mofile.com/cn/xplayer.swf?v=FLASHVAR',
			};
			var video_click_event = function(){
				var _host = $(this).attr('host');					//视频的host
				var _flashvar = $(this).attr('flashvar');			//视频的ID
				var _flash_width = $(this).attr('video_width'); 	//视频框的宽度
				var _flash_height = $(this).attr('video_height');	//视频框的高度
				var flash = _flashAddr[_host].replace('FLASHVAR', _flashvar);
				flash = _videoFlash.replace(/FLASHADDR/g, flash).replace(/FLASHWIDTH/g, _flash_width).replace(/FLASHHEIGHT/g, _flash_height)
				$(this).attr('_img',$(this).html());		//保留img信息
				$(this).html(flash).after('<a class=\'video_hide\'>收起</a>');					//把视频放入容器
				$('.video_hide').css('cursor','pointer').bind('click',function(){
					$(this).prev().html($(this).prev().attr('_img')).bind('click',video_click_event);
					$(this).remove();
					return false;
				})
				$(this).unbind('click');
			}
			$(this).each(function(){
				$(this).bind('click',video_click_event)
			})
			return false;
		}
	})
})(jQuery);
